<!--底部导航-->
<style>
    .bb{
        display: block;
        position: absolute;
        top: 5px;
        right: 104px;
        z-index: 999;
        width: 16px;
        line-height: 16px;
        height: 16px;
        color: #fff;
        background: #ffad01;
        border-radius: 50%;
    }
</style>
<div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default" id="">
    <ul class="am-navbar-nav am-cf am-avg-sm-4">
        <li>
            <a href="__APP__/Home/Index">
                <eq name="page_str" value="home">
                    <img src="__PUBLIC__/new_images/sm_logo.png"  alt="logo" style="width: 35px;height: 37px;margin-top: 7px;">
                    <else/>
                    <img src="__PUBLIC__/new_images/home.png" alt="home"><span>首页</span>
                </eq>
            </a>
        </li>
        <li>
            <a href="__APP__/Home/Category">
                <eq name="page_str" value="category">
                    <img src="__PUBLIC__/new_images/class_yes.png" alt="class"><span>分类</span>
                    <else/>
                    <img src="__PUBLIC__/new_images/class.png" alt="class"><span>分类</span>
                </eq>

            </a>
        </li>
        <li >
            <a href="__APP__/Home/ShopCart">
                <eq name="page_str" value="shopcart">
                    <img src="__PUBLIC__/new_images/shopcart.png" alt="shopcart"><span>购物车</span>
                    <!--<a href="#" id="cart_num"></a>-->
                    <span id="cart_num"></span>
                    <else/>
                    <img src="__PUBLIC__/new_images/shopcart_no.png" alt="shopcart" >
                    <span style="position: relative;">购物车</span>
                    <span id="cart_num"></span>
                </eq>

            </a>
        </li>
        <li>
            <a href="__APP__/Home/Me">
                <eq name="page_str" value="me">
                    <img src="__PUBLIC__/new_images/user.png" alt="user"><span>我的</span>
                    <else/>
                    <img src="__PUBLIC__/new_images/user_no.png" alt="user"><span>我的</span>
                </eq>
            </a>
        </li>
    </ul>
</div>
<script src="__PUBLIC__/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
<script>
    $(function () {

        shopCartNum();
    });
    function shopCartNum(){
        $.ajax({

            type:"get",
            url:"__APP__/Home/ShopCart/ajaxShopCartNum",
            error:function (data) {
                console.info(data);
            },
            success:function (data) {
                console.info(data);
                if(data.success){
                    if(data.num >0) {
                        $('#cart_num').addClass('bb');
                        $('#cart_num').empty().html(data.num + '');
                        var w = document.body.clientWidth*0.325;
                        $(".bb").css("right",w);
                    }
                }
            }
        });
    }

</script>